<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<?php
include('../resource/menu.php');
?>
<html>
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		
        <link href="../resource/responsive/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="../resource/responsive/bootstrap-responsive.min.css" rel="stylesheet">
        <script src="../resource/responsive/jquery.min.js"></script>
        <script src="../resource/responsive/bootstrap.min.js"></script>
        <!--    FORMATO DE TABLAS    -->
        <link href="../resource/table/demo_table.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" language="javascript" src="../resource/table/jquery.dataTables.js"></script>
        <!--    FORMATO DE TABLAS    -->

		<script type="text/javascript">
		$(document).ready(function(){
			//setInterval(function(){alert("Hello")},3000);

		   $('#contactos').dataTable( { //CONVERTIMOS NUESTRO LISTADO DE LA FORMA DEL JQUERY.DATATABLES- PASAMOS EL ID DE LA TABLA
		        "sPaginationType": "full_numbers" //DAMOS FORMATO A LA PAGINACION(NUMEROS)
		    } );
		})

		function js_Eliminar(id_cl) {
			if (window.confirm("¿Está seguro que desea eliminar el registro seleccionado?")) {
			   	   location.href = "eliminar.php?IDCT=" + id_cl;
			}
		}

		</script>
	</head>
<body>
 	<div id="navbar"></div>

<div class="span9">
    <div class="hero-unit">
    	<section id="tables">
    	<div class="page-header">
					    
	<?php

		include('../resource/config.php'); 
		$result = mysql_query("SELECT * FROM `regcon`"); 

		$sexo;
		echo "<table class='table table-bordered table-striped table-hover' id='contactos'>"; 
		echo "<thead><tr>"; 
		echo "<th>ID</th>"; 
		echo "<th>Nombre</th>"; 
		echo "<th>Tel Movil</th>"; 
		echo "<th>Acciones</th>"; 
		echo "</tr></thead><tbody>"; 
		
		while($row = mysql_fetch_array($result)){ 
		foreach($row AS $key => $value) { $row[$key] = stripslashes($value); } 
		echo "<tr>";  
		echo "<td>" . $row['IDCT'] . "</td>";  
		echo "<td>" . $row['NOCT'] . "</td>";  
		echo "<td>" . $row['TEC1'] . "</td>";  

		echo "<td><a href=editar.php?IDCT={$row['IDCT']}><img src ='../resource/images/update.png'></a><a href=javascript:js_Eliminar({$row['IDCT']})><img src ='../resource/images/delete.png'></a><a href=ver.php?IDCT={$row['IDCT']}><img src ='../resource/images/view.png'></a></td>"; 
		
		echo "</tr>"; 
		} 
		echo "</tbody></table>"; 
		?>
    			<br><br><div class="btn-group span4">
				    <a class="btn btn-primary" href="#nuevo" role="button" data-toggle="modal">Nuevo Contacto</a>
				</div>
		</div>
		</section>
	</div>
</div>



<!-- MODAL -->
<div id="nuevo" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3 id="myModalLabel">Nuevo Contacto</h3>
  </div>
  <div class="modal-body">
  	<?php include('crear.php');?>
  	<div id="crear"></div>
  </div>
</div>



<body>
</html>